<template>
    <div class="container">
        <div class="handle-box">
                <el-form ref="form" :model="form" label-width="90px" class="flex">
                    <!-- <el-form-item label="所属街道：">
                        <el-input v-model="name" placeholder="请输入名称" class="handle-input mr10"></el-input>
                    </el-form-item>
                    <el-form-item label="所属社区：">
                        <el-input v-model="name" placeholder="请输入名称" class="handle-input mr10"></el-input>
                    </el-form-item> -->
                    <el-form-item label="小区名称：">
                        <el-input v-model="name" placeholder="请输入名称" class="handle-input mr10"></el-input>
                        <el-cascader v-model="COMMUNITY_ID" :options="options" :show-all-levels="false"clearable="true" @change="getdata()"></el-cascader>
                    </el-form-item>
                    <!-- <el-form-item label="日期范围：">
                       <el-date-picker
                            v-model="value1"
                            type="daterange"
                            range-separator="至"
                            start-placeholder="开始日期"
                            end-placeholder="结束日期">
                        </el-date-picker>
                    </el-form-item> -->
                    <el-form-item>
                        <el-button type="primary" icon="el-icon-search" @click="getdata()">搜索</el-button>
                        <!-- <el-button type="success" icon="el-icon-circle-plus-outline" @click="addvialog()">新增</el-button> -->
                    </el-form-item>
                    
                </el-form>
            </div>
            <el-table
                :data="tableData.slice((currentPage-1)*pagesize,currentPage*pagesize)"
            >
                <el-table-column prop="VILLAGE_ID" label="ID" width="55" align="center"></el-table-column>
                <el-table-column prop="STREET_NAME" label="所属街道"></el-table-column>
                <el-table-column prop="COMMUNITY_NAME" label="所属社区"></el-table-column>
                <el-table-column prop="VILLAGE_NAME" label="小区名称"></el-table-column>
                <!-- <el-table-column prop="date" label="日期范围"></el-table-column> -->
                <!-- <el-table-column prop="integral" label="可回收垃圾累计积分"></el-table-column> -->
                <!-- <el-table-column prop="score" label="可回收垃圾消费积分"></el-table-column> -->
                <!-- <el-table-column prop="remaining" label="可回收垃圾剩余积分"></el-table-column> -->
                <!-- <el-table-column prop="chuyuintegral" label="厨余收垃圾累计积分"></el-table-column> -->
                <!-- <el-table-column prop="chuyuscore" label="厨余收垃圾消费积分"></el-table-column> -->
                <!-- <el-table-column prop="chuyuremaining" label="厨余收垃圾剩余积分"></el-table-column> -->
                <!-- <el-table-column prop="youhaiintegral" label="有害收垃圾累计积分"></el-table-column> -->
                <!-- <el-table-column prop="youhaiscore" label="有害收垃圾消费积分"></el-table-column> -->
                <!-- <el-table-column prop="youhairemaining" label="有害收垃圾剩余积分"></el-table-column> -->
                <!-- <el-table-column prop="qitaintegral" label="其他收垃圾累计积分"></el-table-column> -->
                <el-table-column prop="TotalPoints" label="累计积分">
                    <template scope="scope">
                        <div class="u" @click="getMore(scope.row)">{{ scope.row.TotalPoints }}</div>
                    </template>
                </el-table-column>
                <el-table-column prop="ConsumePoints" label="消费积分">
                    <template scope="scope">
                        <div class="u" @click="getscoreMore(scope.row)">{{ scope.row.ConsumePoints }}</div>
                    </template>
                </el-table-column>
                <el-table-column prop="SurplusPoints" label="剩余积分"></el-table-column>
            </el-table>
            <div class="pagination">
                <el-pagination
                    background
                    layout="total, sizes, prev, pager, next, jumper"
                    :current-page="currentPage"  
                    :page-size="pageSize"
                    :total="tableData.length"
                    @size-change="handleSizeChange"
                    @current-change="handlePageChange"
                ></el-pagination>
            </div>
            <!-- 编辑弹出框 -->
            <el-dialog v-dialogDrag title="信息" :visible.sync="editVisible" width="50%" >
                <el-form ref="form" :model="form" label-width="70px" class="diaglos display">
                    <el-form-item label="所属街道：" :label-width="formLabelWidth" class="wid50">
                        <input v-model="form.address" class="inputstyle" type="text" disabled="disabled"></input>
                    </el-form-item>
                    <el-form-item label="所属社区：" :label-width="formLabelWidth" class="wid50">
                        <input v-model="form.community" class="inputstyle" type="text" disabled="disabled"></input>
                    </el-form-item>
                    <el-form-item label="小区名称：" :label-width="formLabelWidth" class="wid50">
                        <input v-model="form.plot" class="inputstyle" type="text" disabled="disabled"></input>
                    </el-form-item>
                    <el-form-item label="日期范围：" :label-width="formLabelWidth" class="wid50">
                        <input v-model="form.date" class="inputstyle" type="text" disabled="disabled"></input>
                    </el-form-item>
                    <el-form-item label="可回收垃圾累计积分：" :label-width="formLabelWidth" class="wid50">
                        <input v-model="form.integral" class="inputstyle" type="text" disabled="disabled"></input>
                    </el-form-item>
                    <el-form-item label="厨余垃圾累计积分：" :label-width="formLabelWidth" class="wid50">
                        <input v-model="form.chuyuintegral" class="inputstyle" type="text" disabled="disabled"></input>
                    </el-form-item>
                    <el-form-item label="有害垃圾累计积分：" :label-width="formLabelWidth" class="wid50">
                        <input v-model="form.youhaiintegral" class="inputstyle" type="text" disabled="disabled"></input>
                    </el-form-item>
                    <el-form-item label="其他垃圾累计积分：" :label-width="formLabelWidth" class="wid50">
                        <input v-model="form.qitaintegral" class="inputstyle" type="text" disabled="disabled"></input>
                    </el-form-item>
                </el-form>
                <span slot="footer" class="dialog-footer">
                    <el-button @click="editVisible = false">取 消</el-button>
                    <el-button type="primary" @click="saveEdit">确 定</el-button>
                </span>
            </el-dialog>
                <!-- 累计积分明细 -->
             <el-dialog v-dialogDrag title="累计积分明细" :visible.sync="getmoredialog" width="50%" >
                 <el-table
                    :data="tableDatas"
                    border
                    style="width: 100%">
                    <el-table-column
                      prop="VILLAGE_ID"
                      label="小区ID"
                      width="180">
                    </el-table-column>
                    <el-table-column
                      prop="BUILDING"
                      label="楼号"
                      width="180">
                    </el-table-column>
                    <el-table-column
                      prop="UNIT"
                      label="单元">
                    </el-table-column>
                    <el-table-column
                     
                      label="积分">
                        <template scope="scope">
                            <div class="u" @click="gettonnage(scope.row)">{{ scope.row.Points }}</div>
                        </template>
                    </el-table-column>
                </el-table>
            </el-dialog>
            <!-- 消费积分明细 -->
             <el-dialog v-dialogDrag title="消费积分明细" :visible.sync="getscoremoredialog" width="50%" >
                 <el-table
                    :data="tableDatasred"
                    border
                    style="width: 100%">
                    <el-table-column
                      prop="VILLAGE_ID"
                      label="小区ID"
                      width="180">
                    </el-table-column>
                    <el-table-column
                      prop="BUILDING"
                      label="楼号"
                      width="180">
                    </el-table-column>
                    <el-table-column
                      prop="UNIT"
                      label="单元">
                    </el-table-column>
                    <el-table-column
                     
                      label="积分">
                        <template scope="scope">
                            <div class="u" @click="getscoreMorered(scope.row)">{{ scope.row.Points }}</div>
                        </template>
                    </el-table-column>
                </el-table>
            </el-dialog>
            <!-- 新增弹出框 -->
             <el-dialog v-dialogDrag title="新增" :visible.sync="adddatevialog" width="50%" >
                 <el-form ref="addform" :model="addform" label-width="70px" class="diaglos display">
                    <el-form-item label="小区名称：" :label-width="formLabelWidth" class="wid50">
                        <el-input v-model="addform.address" ></el-input>
                    </el-form-item>
                    <el-form-item label="小区累计积分：" :label-width="formLabelWidth" class="wid50">
                        <el-input v-model="addform.totalintegral"></el-input>
                    </el-form-item>
                    <el-form-item label="小区消费积分：" :label-width="formLabelWidth" class="wid50">
                        <el-input v-model="addform.totalscore"></el-input>
                    </el-form-item>
                    <el-form-item label="小区剩余积分：" :label-width="formLabelWidth" class="wid50">
                        <el-input v-model="addform.totalremaining"></el-input>
                    </el-form-item> 
                </el-form>
                <span slot="footer" class="dialog-footer">
                    <el-button @click="adddatevialog = false">取 消</el-button>
                    <el-button type="primary" @click="saveEditvialog">确 定</el-button>
                </span>
            </el-dialog>

            <!-- 小区累计积分明细 -->
            <el-dialog v-dialogDrag title="明细" :visible.sync="gettonnages" width="38%" >
                <el-table
                    :data="ljintegral"
                    height="250"
                    border
                    style="width: 100%">
                    <el-table-column
                      prop="VID"
                      label="居民ID"
                      width="180">
                    </el-table-column>
                    <el-table-column
                      prop="NAME"
                      label="居民姓名"
                      width="180">
                    </el-table-column>
                    <el-table-column
                      prop="Points"
                      label="积分">
                    </el-table-column>
                </el-table>
            </el-dialog>
             <!-- 小区消费积分明细 -->
            <el-dialog v-dialogDrag title="明细" :visible.sync="gettonnagesred" width="38%" >
                <el-table
                    :data="xfintegral"
                    height="250"
                    border
                    style="width: 100%">
                    <el-table-column
                      prop="VID"
                      label="居民ID"
                      width="180">
                    </el-table-column>
                    <el-table-column
                      prop="NAME"
                      label="居民姓名"
                      width="180">
                    </el-table-column>
                    <el-table-column
                      prop="Points"
                      label="积分">
                    </el-table-column>
                </el-table>
            </el-dialog>
        </div>
</template>
<script>
import '../../../assets/css/common.css'

export default {
  data () {
    return {
      currentPage: 1, //初始页
      pagesize: 10,    //    每页的数据
      userList: [],
      address: '',
      name: '',
      value1: '',
      formLabelWidth: '160px',
      options: [],
      COMMUNITY_ID: [],
      originalData: [],
      tableData: [{
        id: '1',
        address: "街道1",
        community: '社区1',
        plot: '山里家园',
        date: '2020-7-1~2020-7-30',
        integral: '100',
        score: '2',
        remaining: '98',
        chuyuintegral: '200',
        chuyuscore: '1',
        chuyuremaining: '199',
        youhaiintegral: '100',
        youhaiscore: '2',
        youhairemaining: '98',
        qitaintegral: '100',
        qitascore: '5',
        qitaremaining: '95',
        totalintegral: '5320',
        totalscore: '6420',
        totalremaining: '142'
      }, {
        id: '2',
        address: "街道2",
        community: '社区2',
        plot: '丽景家园',
        date: '2020-7-1~2020-7-20',
        integral: '100',
        score: '2',
        remaining: '98',
        chuyuintegral: '200',
        chuyuscore: '1',
        chuyuremaining: '199',
        youhaiintegral: '100',
        youhaiscore: '2',
        youhairemaining: '98',
        qitaintegral: '100',
        qitascore: '5',
        qitaremaining: '95',
        totalintegral: '5320',
        totalscore: '6420',
        totalremaining: '142'
      }, {
        id: '3',
        address: "街道3",
        community: '社区3',
        plot: '地里家园',
        date: '2020-7-1~2020-7-30',
        integral: '100',
        score: '2',
        remaining: '98',
        chuyuintegral: '200',
        chuyuscore: '1',
        chuyuremaining: '199',
        youhaiintegral: '100',
        youhaiscore: '2',
        youhairemaining: '98',
        qitaintegral: '100',
        qitascore: '5',
        qitaremaining: '95',
        totalintegral: '5320',
        totalscore: '6420',
        totalremaining: '142'
      }, {
        id: '4',
        address: "街道4",
        community: '社区4',
        plot: '里馨家园',
        date: '2020-7-1~2020-7-30',
        integral: '100',
        score: '2',
        remaining: '98',
        chuyuintegral: '200',
        chuyuscore: '1',
        chuyuremaining: '199',
        youhaiintegral: '100',
        youhaiscore: '2',
        youhairemaining: '98',
        qitaintegral: '100',
        qitascore: '5',
        qitaremaining: '95',
        totalintegral: '5320',
        totalscore: '6420',
        totalremaining: '142'
      }, {
        id: '5',
        address: "街道5",
        community: '社区5',
        plot: '山里家园',
        date: '2020-7-1~2020-7-30',
        integral: '100',
        score: '2',
        remaining: '98',
        chuyuintegral: '200',
        chuyuscore: '1',
        chuyuremaining: '199',
        youhaiintegral: '100',
        youhaiscore: '2',
        youhairemaining: '98',
        qitaintegral: '100',
        qitascore: '5',
        qitaremaining: '95',
        totalintegral: '5320',
        totalscore: '6420',
        totalremaining: '142'
      }, {
        id: '6',
        address: "街道6",
        community: '社区6',
        plot: '山里家园',
        date: '2020-7-1~2020-7-30',
        integral: '100',
        score: '2',
        remaining: '98',
        chuyuintegral: '200',
        chuyuscore: '1',
        chuyuremaining: '199',
        youhaiintegral: '100',
        youhaiscore: '2',
        youhairemaining: '98',
        qitaintegral: '100',
        qitascore: '5',
        qitaremaining: '95',
        totalintegral: '5320',
        totalscore: '6420',
        totalremaining: '142'
      }, {
        id: '7',
        address: "街道7",
        community: '社区7',
        plot: '山里家园',
        date: '2020-7-1~2020-7-30',
        integral: '100',
        score: '2',
        remaining: '98',
        chuyuintegral: '200',
        chuyuscore: '1',
        chuyuremaining: '199',
        youhaiintegral: '100',
        youhaiscore: '2',
        youhairemaining: '98',
        qitaintegral: '100',
        qitascore: '5',
        qitaremaining: '95',
        totalintegral: '5320',
        totalscore: '6420',
        totalremaining: '142'
      }, {
        id: '8',
        address: "街道8",
        community: '社区8',
        plot: '山里家园',
        date: '2020-7-1~2020-7-30',
        integral: '100',
        score: '2',
        remaining: '98',
        chuyuintegral: '200',
        chuyuscore: '1',
        chuyuremaining: '199',
        youhaiintegral: '100',
        youhaiscore: '2',
        youhairemaining: '98',
        qitaintegral: '100',
        qitascore: '5',
        qitaremaining: '95',
        totalintegral: '5320',
        totalscore: '6420',
        totalremaining: '142'
      }, {
        id: '9',
        address: "街道9",
        community: '社区9',
        plot: '山里家园',
        date: '2020-7-1~2020-7-30',
        integral: '100',
        score: '2',
        remaining: '98',
        chuyuintegral: '200',
        chuyuscore: '1',
        chuyuremaining: '199',
        youhaiintegral: '100',
        youhaiscore: '2',
        youhairemaining: '98',
        qitaintegral: '100',
        qitascore: '5',
        qitaremaining: '95',
        totalintegral: '5320',
        totalscore: '6420',
        totalremaining: '142'
      }, {
        id: '10',
        address: "街道10",
        community: '社区10',
        plot: '山里家园',
        date: '2020-7-1~2020-7-30',
        integral: '100',
        score: '2',
        remaining: '98',
        chuyuintegral: '200',
        chuyuscore: '1',
        chuyuremaining: '199',
        youhaiintegral: '100',
        youhaiscore: '2',
        youhairemaining: '98',
        qitaintegral: '100',
        qitascore: '5',
        qitaremaining: '95',
        totalintegral: '5320',
        totalscore: '6420',
        totalremaining: '142'
      }, {
        id: '11',
        address: "街道11",
        community: '社区11',
        plot: '山里家园',
        date: '2020-7-1~2020-7-30',
        integral: '100',
        score: '2',
        remaining: '98',
        chuyuintegral: '200',
        chuyuscore: '1',
        chuyuremaining: '199',
        youhaiintegral: '100',
        youhaiscore: '2',
        youhairemaining: '98',
        qitaintegral: '100',
        qitascore: '5',
        qitaremaining: '95',
        totalintegral: '5320',
        totalscore: '6420',
        totalremaining: '142'
      }, {
        id: '12',
        address: "街道12",
        community: '社区12',
        plot: '山里家园',
        date: '2020-7-1~2020-7-30',
        integral: '100',
        score: '2',
        remaining: '98',
        chuyuintegral: '200',
        chuyuscore: '1',
        chuyuremaining: '199',
        youhaiintegral: '100',
        youhaiscore: '2',
        youhairemaining: '98',
        qitaintegral: '100',
        qitascore: '5',
        qitaremaining: '95',
        totalintegral: '5230',
        totalscore: '6420',
        totalremaining: '142'
      }],
      multipleSelection: [],
      delList: [],
      editVisible: false,
      pageTotal: 0,
      form: {},
      idx: -1,
      id: -1,
      ljintegral: [{
        name: '张三',
        integral: '30'
      }, {
        name: '张茜',
        integral: '50'
      }, {
        name: '王晓',
        integral: '60'
      }, {
        name: '马钰欠',
        integral: '80'
      }, {
        name: '辛月贝',
        integral: '20'
      }],
      mxintegral: [{
        number: '1号楼',
        unit: '1单元',
        tonnage: '500'
      }, {
        number: '1号楼',
        unit: '2单元',
        tonnage: '320'
      }, {
        number: '1号楼',
        unit: '3单元',
        tonnage: '100'
      }, {
        number: '11号楼',
        unit: '2单元',
        tonnage: '100'
      }, {
        number: '7号楼',
        unit: '1单元',
        tonnage: '200'
      }, {
        number: '9号楼',
        unit: '3单元',
        tonnage: '500'
      }, {
        number: '11号楼',
        unit: '1单元',
        tonnage: '500'
      }, {
        number: '6号楼',
        unit: '3单元',
        tonnage: '800'
      }, {
        number: '10号楼',
        unit: '2单元',
        tonnage: '300'
      }, {
        number: '15号楼',
        unit: '1单元',
        tonnage: '500'
      }, {
        number: '3号楼',
        unit: '1单元',
        tonnage: '300'
      }, {
        number: '13号楼',
        unit: '2单元',
        tonnage: '500'
      }, {
        number: '17号楼',
        unit: '3单元',
        tonnage: '500'
      }, {
        number: '15号楼',
        unit: '3单元',
        tonnage: '500'
      }, {
        number: '16号楼',
        unit: '3单元',
        tonnage: '500'
      }],
      adddatevialog: false,
      communitydetail: [{
        index: '1',
        communname: [{
          streename: '华苑街道',
          plotname: '丽华里',
          communityname: '丽华里社区',
          communtonnage: '80',
          residentsname: '张倩',
        }, {
          streename: '美元街道',
          plotname: '荻花里',
          communtonnage: '80',
          residentsname: '张倩',
          communityname: '丽华里社区',
        }, {
          streename: '梅苑街道',
          plotname: '科信里',
          communtonnage: '80',
          residentsname: '张倩',
          communityname: '丽华里社区',
        }, {
          streename: '梅苑街道',
          plotname: '科信里',
          communtonnage: '80',
          residentsname: '张倩',
          communityname: '丽华里社区',
        }, {
          streename: '美元街道',
          plotname: '荻花里',
          communtonnage: '80',
          residentsname: '张倩',
          communityname: '丽华里社区',
        },]
      }, {
        index: '2',
        communname: [{
          streename: '华苑街道',
          plotname: '丽华里',
          communtonnage: '80',
          residentsname: '张倩',
          communityname: '丽华里社区',
        }, {
          streename: '美元街道',
          plotname: '荻花里',
          communtonnage: '80',
          residentsname: '张倩',
          communityname: '丽华里社区',
        }, {
          streename: '梅苑街道',
          plotname: '科信里',
          communtonnage: '80',
          residentsname: '张倩',
          communityname: '丽华里社区',
        }, {
          streename: '梅苑街道',
          plotname: '科信里',
          communtonnage: '80',
          residentsname: '张倩',
          communityname: '丽华里社区',
        }, {
          streename: '美元街道',
          plotname: '荻花里',
          communtonnage: '80',
          residentsname: '张倩',
          communityname: '丽华里社区',
        },]
      }, {
        index: '3',
        communname: [{
          streename: '华苑街道',
          plotname: '丽华里',
          communtonnage: '80',
          residentsname: '张倩',
          communityname: '丽华里社区',
        }, {
          streename: '美元街道',
          plotname: '荻花里',
          communtonnage: '80',
          residentsname: '张倩',
          communityname: '丽华里社区',
        }, {
          streename: '梅苑街道',
          plotname: '科信里',
          communtonnage: '80',
          residentsname: '张倩',
          communityname: '丽华里社区',
        }, {
          streename: '梅苑街道',
          plotname: '科信里',
          communtonnage: '80',
          residentsname: '张倩',
          communityname: '丽华里社区',
        }, {
          streename: '美元街道',
          plotname: '荻花里',
          communtonnage: '80',
          residentsname: '张倩',
          communityname: '丽华里社区',
        },]
      }, {
        index: '4',
        communname: [{
          streename: '华苑街道',
          plotname: '丽华里',
          communtonnage: '80',
          residentsname: '张倩',
          communityname: '丽华里社区',
        }, {
          streename: '美元街道',
          plotname: '荻花里',
          communtonnage: '80',
          residentsname: '张倩',
          communityname: '丽华里社区',
        }, {
          streename: '梅苑街道',
          plotname: '科信里',
          communtonnage: '80',
          residentsname: '张倩',
          communityname: '丽华里社区',
        }, {
          streename: '梅苑街道',
          plotname: '科信里',
          communtonnage: '80',
          residentsname: '张倩',
          communityname: '丽华里社区',
        }, {
          streename: '美元街道',
          plotname: '荻花里',
          communtonnage: '80',
          residentsname: '张倩',
          communityname: '丽华里社区',
        },]
      }, {
        index: '5',
        communname: [{
          streename: '华苑街道',
          plotname: '丽华里',
          communtonnage: '80',
          residentsname: '张倩',
          communityname: '丽华里社区',
        }, {
          streename: '美元街道',
          plotname: '荻花里',
          communtonnage: '80',
          residentsname: '张倩',
          communityname: '丽华里社区',
        }, {
          streename: '梅苑街道',
          plotname: '科信里',
          communtonnage: '80',
          residentsname: '张倩',
          communityname: '丽华里社区',
        }, {
          streename: '梅苑街道',
          plotname: '科信里',
          communtonnage: '80',
          residentsname: '张倩',
          communityname: '丽华里社区',
        }, {
          streename: '美元街道',
          plotname: '荻花里',
          communtonnage: '80',
          residentsname: '张倩',
          communityname: '丽华里社区',
        },]
      }, {
        index: '6',
        communname: [{
          streename: '华苑街道',
          plotname: '丽华里',
          communtonnage: '80',
          residentsname: '张倩',
          communityname: '丽华里社区',
        }, {
          streename: '美元街道',
          plotname: '荻花里',
          communtonnage: '80',
          residentsname: '张倩',
          communityname: '丽华里社区',
        }, {
          streename: '梅苑街道',
          plotname: '科信里',
          communtonnage: '80',
          residentsname: '张倩',
          communityname: '丽华里社区',
        }, {
          streename: '梅苑街道',
          plotname: '科信里',
          communtonnage: '80',
          residentsname: '张倩',
          communityname: '丽华里社区',
        }, {
          streename: '美元街道',
          plotname: '荻花里',
          communtonnage: '80',
          residentsname: '张倩',
          communityname: '丽华里社区',
        },]
      }, {
        index: '7',
        communname: [{
          streename: '华苑街道',
          plotname: '丽华里',
          communtonnage: '80',
          residentsname: '张倩',
          communityname: '丽华里社区',
        }, {
          streename: '美元街道',
          plotname: '荻花里',
          communtonnage: '80',
          residentsname: '张倩',
          communityname: '丽华里社区',
        }, {
          streename: '梅苑街道',
          plotname: '科信里',
          communtonnage: '80',
          residentsname: '张倩',
          communityname: '丽华里社区',
        }, {
          streename: '梅苑街道',
          plotname: '科信里',
          communtonnage: '80',
          residentsname: '张倩',
          communityname: '丽华里社区',
        }, {
          streename: '美元街道',
          plotname: '荻花里',
          communtonnage: '80',
          residentsname: '张倩',
          communityname: '丽华里社区',
        },]
      }, {
        index: '8',
        communname: [{
          streename: '华苑街道',
          plotname: '丽华里',
          communtonnage: '80',
          residentsname: '张倩',
          communityname: '丽华里社区',
        }, {
          streename: '美元街道',
          plotname: '荻花里',
          communtonnage: '80',
          residentsname: '张倩',
          communityname: '丽华里社区',
        }, {
          streename: '梅苑街道',
          plotname: '科信里',
          communtonnage: '80',
          residentsname: '张倩',
          communityname: '丽华里社区',
        }, {
          streename: '梅苑街道',
          plotname: '科信里',
          communtonnage: '80',
          residentsname: '张倩',
          communityname: '丽华里社区',
        }, {
          streename: '美元街道',
          plotname: '荻花里',
          communtonnage: '80',
          residentsname: '张倩',
          communityname: '丽华里社区',
        },]
      }, {
        index: '9',
        communname: [{
          streename: '华苑街道',
          plotname: '丽华里',
          communtonnage: '80',
          residentsname: '张倩',
          communityname: '丽华里社区',
        }, {
          streename: '美元街道',
          plotname: '荻花里',
          communtonnage: '80',
          residentsname: '张倩',
          communityname: '丽华里社区',
        }, {
          streename: '梅苑街道',
          plotname: '科信里',
          communtonnage: '80',
          residentsname: '张倩',
          communityname: '丽华里社区',
        }, {
          streename: '梅苑街道',
          plotname: '科信里',
          communtonnage: '80',
          residentsname: '张倩',
          communityname: '丽华里社区',
        }, {
          streename: '美元街道',
          plotname: '荻花里',
          communtonnage: '80',
          residentsname: '张倩',
          communityname: '丽华里社区',
        },]
      }, {
        index: '10',
        communname: [{
          streename: '华苑街道',
          plotname: '丽华里',
          communtonnage: '80',
          residentsname: '张倩',
          communityname: '丽华里社区',
        }, {
          streename: '美元街道',
          plotname: '荻花里',
          communtonnage: '80',
          residentsname: '张倩',
          communityname: '丽华里社区',
        }, {
          streename: '梅苑街道',
          plotname: '科信里',
          communtonnage: '80',
          residentsname: '张倩',
          communityname: '丽华里社区',
        }, {
          streename: '梅苑街道',
          plotname: '科信里',
          communtonnage: '80',
          residentsname: '张倩',
          communityname: '丽华里社区',
        }, {
          streename: '美元街道',
          plotname: '荻花里',
          communtonnage: '80',
          residentsname: '张倩',
          communityname: '丽华里社区',
        },]
      }, {
        index: '11',
        communname: [{
          streename: '华苑街道',
          plotname: '丽华里',
          communtonnage: '80',
          residentsname: '张倩',
          communityname: '丽华里社区',
        }, {
          streename: '美元街道',
          plotname: '荻花里',
          communtonnage: '80',
          residentsname: '张倩',
          communityname: '丽华里社区',
        }, {
          streename: '梅苑街道',
          plotname: '科信里',
          communtonnage: '80',
          residentsname: '张倩',
          communityname: '丽华里社区',
        }, {
          streename: '梅苑街道',
          plotname: '科信里',
          communtonnage: '80',
          residentsname: '张倩',
          communityname: '丽华里社区',
        }, {
          streename: '美元街道',
          plotname: '荻花里',
          communtonnage: '80',
          residentsname: '张倩',
          communityname: '丽华里社区',
        },]
      }, {
        index: '12',
        communname: [{
          streename: '华苑街道',
          plotname: '丽华里',
          communtonnage: '80',
          residentsname: '张倩',
          communityname: '丽华里社区',
        }, {
          streename: '美元街道',
          plotname: '荻花里',
          communtonnage: '80',
          residentsname: '张倩',
          communityname: '丽华里社区',
        }, {
          streename: '梅苑街道',
          plotname: '科信里',
          communtonnage: '80',
          residentsname: '张倩',
          communityname: '丽华里社区',
        }, {
          streename: '梅苑街道',
          plotname: '科信里',
          communtonnage: '80',
          residentsname: '张倩',
          communityname: '丽华里社区',
        }, {
          streename: '美元街道',
          plotname: '荻花里',
          communtonnage: '80',
          residentsname: '张倩',
          communityname: '丽华里社区',
        },]
      }],
      communitydetaildata: '',
      getmoredialog: false,
      getscoremoredialog: false,
      tableDatas: '',
      tableDatasred: '',
      xfintegral: '',
      addform: {
        address: '',
        totalintegral: '',
        totalscore: '',
        totalremaining: ''
      },
      gettonnages: false,
      gettonnagesred: false

    }
  },
  created () {
    this.getdata();
    this.loadCheckbox_SCV()
  },
  methods: {
    getdata () {
      // const { data } =await this.$axios.get(this.$iurl+'/GetVillageIntegralListApi')
      this.$axios({
        url: this.$iurl + '/GetVillageIntegralListApi',
        method: 'get',
        params: {
          ClientNo: localStorage.getItem('clentno')
        }
      }).then(res => {
        this.originalData = Object.assign([], res.data)
        this.mohu()
      })
      // this.tableData = data.filter(item=>{
      //     return item 
      // })
    },
    //累计积分二层弹框
    async gettonnage (row) {
      this.$axios({
        url: this.$iurl + '/GetVillageTotalPointsPeopleDetailApi',
        method: 'get',
        params: {
          VILLAGE_ID: row.VILLAGE_ID,
          BUILDING: row.BUILDING,
          UNIT: row.UNIT
        }
      }).then(item => {
        if (item.status == 200) {
          this.ljintegral = Object.assign([], item.data)
        }
      })
      this.gettonnages = true
    },
    async saveEditvialog () {
      this.adddatevialog = false
    },
    //新增弹出框
    async addvialog () {
      this.adddatevialog = true
    },
    //累计积分弹框
    async getMore (row) {
      this.$axios({
        url: this.$iurl + '/GetVillageCumulativeIntegralDetailApi',
        method: 'get',
        params: {
          VILLAGE_ID: row.VILLAGE_ID
        }
      }).then(item => {
        if (item.status == 200) {
          this.tableDatas = Object.assign([], item.data)
        }

      })
      this.getmoredialog = true
      console.log(row);
    },
    //消费积分二层弹框
    async getscoreMorered (row) {
      this.$axios({
        url: this.$iurl + '/GetVillageConsumePointsPeopleDetailApi',
        method: 'get',
        params: {
          VILLAGE_ID: row.VILLAGE_ID,
          BUILDING: row.BUILDING,
          UNIT: row.UNIT
        }
      }).then(item => {
        if (item.status == 200) {
          this.xfintegral = Object.assign([], item.data)
        }
      })
      this.gettonnagesred = true
    },
    //消费积分弹框
    async getscoreMore (row) {
      this.$axios({
        url: this.$iurl + '/GetVillageConsumptionPointsDetailApi',
        method: 'get',
        params: {
          VILLAGE_ID: row.VILLAGE_ID
        }
      }).then(item => {
        if (item.status == 200) {
          this.tableDatasred = Object.assign([], item.data)
        }

      })
      this.getscoremoredialog = true
    },
    async loadCheckbox_SCV () {
      var url = this.$url + '/GetGroupsSQApi?ClientNo=' + localStorage.getItem('clentno');
      const { data } = await this.$axios.get(url)
      this.options = data.filter(item => {
        return item
      })
    },
    mohu () {
      this.tableData = this.originalData
      if (this.COMMUNITY_ID[1]) this.tableData = this.tableData.filter(item => item.COMMUNITY_ID == this.COMMUNITY_ID[1])
      if (this.name) this.tableData = this.tableData.filter(item => item.VILLAGE_NAME.includes(this.name))

    },
    // 编辑操作
    handleEdit (index, row) {
      this.idx = index;
      this.form = row;
      this.editVisible = true;
    },
    // 保存编辑
    saveEdit () {
      this.editVisible = false;
      this.$message.success(`修改第 ${this.idx + 1} 行成功`);
      this.$set(this.tableData, this.idx, this.form);
    },
    // 分页导航
    handlePageChange (currentPage) {
      this.currentPage = currentPage;
      console.log(this.currentPage)
      // this.$set(this.query, 'pageIndex', val);
      // this.getData();
    },
    handleSizeChange (size) {
      this.pagesize = size;
      console.log(this.pagesize)
    }
  }
}
</script>
<style scoped>
</style>